import { exInput, exRadioGroup, exSwitch, exSelectAllowCreate } from '@ve/common/components/extension'
import { exInputNumber } from '../../extension/index'
export default {
  VERSION: '20220624',
  type: 'uiScatterChart',
  name: '散点图',
  icon: 'bar-chart-fill',
  extension: {
    requestSet: {
      type: 'exRequestSet',
      name: '接口配置',
      value: {
        api: '/wms/wms-web',
        method: 'wms.screen.query.test',
        getDataKey: 'wms.screen.query.test',
        loopRequest: false,
        loopTime: 3000,
        nameKey: '',
        valueKey: '',
        busList: [],
        dataObj: {},
        data: [
          { key: '#LIMIT#', value: '1' },
          { key: '#PAGE_SIZE#', value: '10' },
        ],
        resList: [],
      },
    },
    title_show: exSwitch('是否显示标题', true),
    title_text: exInput('图表标题', '标题'),
    title_left: exSelectAllowCreate(
      '标题横向位置',
      'center',
      [
        {
          value: 'left',
          label: '左',
        },
        {
          value: 'center',
          label: '中',
        },
        {
          value: 'right',
          label: '右',
        },
      ],
      '标题横向位置,可自定义'
    ),
    title_top: exSelectAllowCreate(
      '标题纵向位置',
      'top',
      [
        {
          value: 'top',
          label: '上',
        },
        {
          value: 'middle',
          label: '中',
        },
        {
          value: 'bottom',
          label: '下',
        },
      ],
      '标题纵向位置,可自定义'
    ),
    tooltip: {
      type: 'exSwitchToolTip',
      name: '配置提示框',
      value: {
        show: true,
        trigger: 'item',
        triggerOn: 'mousemove',
        showDelay: 0,
        hideDelay: 100,
        backgroundColor: '#fff',
        borderColor: '#fff',
        borderWidth: 0,
        padding: 5,
        textStyle: {
          color: '#888',
          fontSize: 14,
          fontWeight: 'normal',
        },
        formatter: '{a}:<br>{b}:{c}',
      },
    },
    legend_show: exSwitch('显示图例', true),
    legend_itemStyle_color: {
      type: 'exSetChartColor',
      name: '颜色配置',
      value: '#f2f2f2',
    },
    legend_orient: exRadioGroup('图例组件方向', 'vertical', [
      {
        value: 'horizontal',
        label: '横',
      },
      {
        value: 'vertical',
        label: '竖',
      },
    ]),
    legend_type: exRadioGroup('图例展示类型', 'scroll', [
      {
        value: 'scroll',
        label: '分页',
      },
      {
        value: 'plain',
        label: '全部展示',
      },
    ]),
    legend_left: exSelectAllowCreate(
      '图例组件横向位置',
      'left',
      [
        {
          value: 'left',
          label: '左',
        },
        {
          value: 'center',
          label: '中',
        },
        {
          value: 'right',
          label: '右',
        },
      ],
      '图例组件横向位置，可自定义'
    ),
    legend_top: exSelectAllowCreate(
      '图例组件纵向位置',
      'top',
      [
        {
          value: 'top',
          label: '上',
        },
        {
          value: 'middle',
          label: '中',
        },
        {
          value: 'bottom',
          label: '下',
        },
      ],
      '图例组件纵向位置,可自定义'
    ),
    legend_icon: exSelectAllowCreate(
      '图例图形',
      'rect',
      [
        {
          value: 'rect',
          label: '方形',
        },
        {
          value: 'circle',
          label: '圆形',
        },
        {
          value: 'roundRect',
          label: '圆角方形',
        },
        {
          value: 'triangle',
          label: '三角形',
        },
        {
          value: 'diamond',
          label: '菱形',
        },
        {
          value: 'pin',
          label: '大头针',
        },
        {
          value: 'arrow',
          label: '箭头',
        },
      ],
      '可自定义,格式image://图片链接'
    ),
    legend_formatter: exInput('格式化数据', ''),
    legend_itemWidth: exInputNumber('图例图形宽', 10, 1, 100),
    legend_itemHeight: exInputNumber('图例图形高', 10, 1, 100),
    legend_textStyle_fontSize: exInput('字体大小', 10),
    color: {
      type: 'exChartColor',
      name: '颜色配置',
      value: [
        {
          v: '#EE6666',
        },
        {
          v: '#73C0DE',
        },
        {
          v: '#5470C6',
        },
        {
          v: '#91CC75',
        },
        {
          v: '#FAC858',
        },
      ],
    },
    xAxis: {
      type: 'exChartAxis',
      name: 'x坐标配置',
      id: 'x',
      value: [
        {
          name: 'x坐标',
          show: true,
          gridIndex: 0,
          alignTicks: true,
          position: 'bottom',
          offset: 0,
          type: 'category',
          nameLocation: 'end',
          nameTextStyle: {
            color: '#000000',
            fontSize: 'auto',
            width: 'auto',
            height: 'auto',
            overflow: 'breakAll',
            ellipsis: '...',
          },
          axisLine: {
            show: true,
            lineStyle: {
              color: '#333',
              width: 1,
              type: 'solid',
              dashOffset: 0,
              cap: 'butt',
              opacity: 1,
            },
          },
          axisTick: {
            show: true,
            interval: 'auto',
            inside: false,
            length: 5,
            lineStyle: {
              color: '#333',
              width: 1,
              type: 'solid',
              dashOffset: 0,
              cap: 'butt',
              opacity: 1,
            },
          },
          axisLabel: {
            show: true,
            interval: 'auto',
            inside: false,
            rotate: 0,
            margin: 0,
            showMinLabel: false,
            showMaxLabel: false,
            hideOverlap: true,
            color: '#EDEDED',
            fontSize: 12,
            backgroundColor: 'transparent',
            padding: 0,
          },
          splitLine: {
            show: true,
            interval: 'auto',
            lineStyle: {
              color: ['#333'],
              width: 1,
              type: 'solid',
              dashOffset: 0,
              cap: 'butt',
              opacity: 1,
            },
          },
          grid: {
            show: false,
            left: '20%',
            top: '20%',
            right: '20%',
            bottom: '20%',
            backgroundColor: 'transparent',
          },
          nameGap: 15,
          nameRotate: 0,
          inverse: false,
          min: 0,
          max: 'auto',
          scale: false,
          splitNumber: 5,
          logBase: 10,
        },
      ],
    },
    yAxis: {
      type: 'exChartAxis',
      name: 'y坐标配置',
      id: 'y',
      value: [
        {
          name: 'y坐标',
          show: true,
          gridIndex: 0,
          alignTicks: true,
          position: 'bottom',
          offset: 0,
          type: 'value',
          nameLocation: 'end',
          nameTextStyle: {
            color: '#000000',
            fontSize: 'auto',
            width: 'auto',
            height: 'auto',
            overflow: 'breakAll',
            ellipsis: '...',
          },
          axisLine: {
            show: true,
            lineStyle: {
              color: '#333',
              width: 1,
              type: 'solid',
              dashOffset: 0,
              cap: 'butt',
              opacity: 1,
            },
          },
          axisTick: {
            show: true,
            interval: 'auto',
            inside: false,
            length: 5,
            lineStyle: {
              color: '#333',
              width: 1,
              type: 'solid',
              dashOffset: 0,
              cap: 'butt',
              opacity: 1,
            },
          },
          axisLabel: {
            show: true,
            interval: 'auto',
            inside: false,
            rotate: 0,
            margin: 0,
            showMinLabel: false,
            showMaxLabel: false,
            hideOverlap: true,
            color: '#EDEDED',
            fontSize: 12,
            backgroundColor: 'transparent',
            padding: 0,
          },
          splitLine: {
            show: true,
            interval: 'auto',
            lineStyle: {
              color: ['#333'],
              width: 1,
              type: 'solid',
              dashOffset: 0,
              cap: 'butt',
              opacity: 1,
            },
          },
          grid: {
            show: false,
            left: '20%',
            top: '20%',
            right: '20%',
            bottom: '20%',
            backgroundColor: 'transparent',
          },
          nameGap: 15,
          nameRotate: 0,
          inverse: false,
          min: 0,
          max: 1000,
          scale: false,
          splitNumber: 5,
          logBase: 10,
        },
      ],
    },
    series: {
      type: 'exChartSeries',
      name: '图表配置',
      id: 'scatter',
      value: [
        {
          type: 'scatter',
          name: '散点图',
          colorBy: 'series',
          coordinateSystem: 'cartesian2d',
          legendHoverLink: true,
          symbol: 'circle',
          symbolSize: 20,
          symbolRotate: 0,
          symbolKeepAspect: false,
          symbolOffset: [0, 0],
          large: false,
          largeThreshold: 2000,
          selectedMode: false,
          clip: true,
          silent: false,
          animation: true,
          animationThreshold: 2000,
          animationDuration: 1000,
          animationDurationUpdate: 300,
          label: {
            show: false,
            position: 'inside',
            rotate: 0,
            offset: [0, 0],
            color: '#000',
            fontSize: 12,
            align: 'left',
            verticalAlign: 'top',
            backgroundColor: 'transparent',
            borderColor: '#000',
            borderWidth: 0,
            borderType: 'solid',
            borderDashOffset: 0,
            borderRadius: 0,
            padding: [0, 0, 0, 0],
            shadowBlur: 10,
            shadowColor: 'transparent',
            shadowOffsetX: 0,
            shadowOffsetY: 0,
            width: 100,
            height: 40,
            textBorderColor: 'transparent',
            extBorderWidth: 0,
            textBorderType: 'solid',
            textBorderDashOffset: 0,
            textShadowColor: 'transparent',
            textShadowBlur: 0,
            textShadowOffsetX: 0,
            textShadowOffsetY: 0,
            overflow: 'truncate',
            ellipsis: '...',
            formatter: '{b}',
          },
          labelLine: {
            show: false,
            showAbove: false,
            smooth: false,
            lineStyle: {
              color: '#000',
              width: 1,
              type: 'solid',
              dashOffset: 0,
              cap: 'butt',
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          // labelLayout: {
          //   hideOverlap: false,
          //   moveOverlap: 'shiftX',
          //   x: 0,
          //   y: 0,
          //   dx: 0,
          //   dy: 0,
          //   rotate: 0,
          //   width: 100,
          //   height: 40,
          //   align: 'left',
          //   verticalAlign: 'top',
          //   fontSize: 12,
          //   draggable: false,
          // },
          itemStyle: {
            color: '#000',
            borderColor: '#000',
            borderWidth: 0,
            borderType: 'solid',
            borderCap: 'butt',
            borderDashOffset: 0,
            shadowBlur: 10,
            shadowColor: 'transparent',
            shadowOffsetX: 0,
            shadowOffsetY: 0,
            opacity: 1,
          },
          emphasis: {
            disabled: false,
            label: {
              show: false,
              position: 'bottom',
              rotate: 0,
              offset: [0, 0],
              color: '#f00',
              fontSize: 12,
              align: 'left',
              verticalAlign: 'top',
              backgroundColor: '#fff',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderRadius: 0,
              padding: [0, 0, 0, 0],
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              width: 'auto',
              height: 'auto',
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
            },
            labelLine: {
              show: false,
              lineStyle: {
                color: 'transparent',
                width: 1,
                type: 'solid',
                dashOffset: 0,
                cap: 'butt',
                shadowBlur: 10,
                shadowColor: 'transparent',
                shadowOffsetX: 0,
                shadowOffsetY: 0,
                opacity: 1,
              },
            },
            itemStyle: {
              color: '#f00',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderCap: 'butt',
              borderDashOffset: 0,
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          blur: {
            label: {
              show: false,
              position: 'inside',
              rotate: 0,
              offset: [0, 0],
              color: '#fff',
              fontSize: 12,
              align: 'left',
              verticalAlign: 'top',
              backgroundColor: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderRadius: 0,
              padding: [0, 0, 0, 0],
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
            },
            labelLine: {
              show: false,
              lineStyle: {
                color: 'transparent',
                width: 1,
                type: 'solid',
                dashOffset: 0,
                cap: 'butt',
                shadowBlur: 10,
                shadowColor: 'transparent',
                shadowOffsetX: 0,
                shadowOffsetY: 0,
                opacity: 1,
              },
            },
            itemStyle: {
              color: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderCap: 'butt',
              borderDashOffset: 0,
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          select: {
            disabled: false,
            label: {
              show: false,
              position: 'inside',
              rotate: 0,
              offset: [0, 0],
              color: '#f00',
              fontSize: 12,
              align: 'left',
              verticalAlign: 'top',
              backgroundColor: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderRadius: 0,
              padding: [0, 0, 0, 0],
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
            },
            labelLine: {
              show: false,
              lineStyle: {
                color: '#000',
                width: 1,
                type: 'solid',
                dashOffset: 0,
                cap: 'butt',
                shadowBlur: 10,
                shadowColor: 'transparent',
                shadowOffsetX: 0,
                shadowOffsetY: 0,
                opacity: 1,
              },
            },
            itemStyle: {
              color: '#f00',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderCap: 'butt',
              borderDashOffset: 0,
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              opacity: 1,
            },
          },
          markPoint: {
            symbol: 'pin',
            symbolSize: 50,
            symbolRotate: 0,
            symbolKeepAspect: false,
            symbolOffset: [0, 0],
            silent: false,
            label: {
              show: true,
              position: 'inside',
              rotate: 0,
              offset: [0, 0],
              color: '#fff',
              fontSize: 12,
              align: 'left',
              verticalAlign: 'top',
              backgroundColor: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderRadius: 0,
              padding: [0, 0, 0, 0],
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
            },
          },
          markLine: {
            symbol: 'pin',
            symbolSize: 50,
            precision: 2,
            silent: false,
            label: {
              show: true,
              position: 'end',
              color: '#fff',
              fontSize: 12,
              align: 'left',
              verticalAlign: 'top',
              backgroundColor: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderRadius: 0,
              padding: [0, 0, 0, 0],
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
            },
          },
          markArea: {
            silent: false,
            label: {
              show: true,
              position: 'end',
              rotate: 0,
              offset: [0, 0],
              color: '#fff',
              fontSize: 12,
              align: 'left',
              verticalAlign: 'top',
              backgroundColor: 'transparent',
              borderColor: '#000',
              borderWidth: 0,
              borderType: 'solid',
              borderDashOffset: 0,
              borderRadius: 0,
              padding: [0, 0, 0, 0],
              shadowBlur: 10,
              shadowColor: 'transparent',
              shadowOffsetX: 0,
              shadowOffsetY: 0,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
            },
          },
          tooltip: {
            positionType: true,
            position: [0, 0],
            backgroundColor: 'rgba(50,50,50,0.7)',
            borderColor: '#333',
            borderWidth: 0,
            padding: [5, 5, 5, 5],
            textStyle: {
              color: '#fff',
              fontSize: 14,
              width: 100,
              height: 40,
              textBorderColor: 'transparent',
              extBorderWidth: 0,
              textBorderType: 'solid',
              textBorderDashOffset: 0,
              textShadowColor: 'transparent',
              textShadowBlur: 0,
              textShadowOffsetX: 0,
              textShadowOffsetY: 0,
              overflow: 'truncate',
              ellipsis: '...',
            },
          },
        },
      ],
    },
  },
  //交互
  interaction: [],
  //条件、逻辑指令
  logicInstruction: [],
}
